let express=require('express');
let app=express();
let session=require('cookie-session');
let ejs=require('ejs');
let svgcaptcha=require('svg-captcha');
app.use(express.urlencoded({extended:false}));
let routerpages=require('./路由中间件')
//配置ejs模板引擎
app.set('view engine','html');
app.set('views',__dirname+'/pages');
app.engine('html',ejs.__express);
// 加载静态资源文件
app.use(express.static(__dirname+'/static'));
// 保存session的名字和秘钥
app.use(session({
    name:'abchdjenjnjm',
    keys:['babjbd','jnsknen']
}));
app.use(routerpages);
app.listen(3000,'127.0.0.1',()=>{
    console.log('启动成功');
});

